import { S } from '../../s';
import { IPSAppCounterRef } from '../../app/control/ipsapp-counter-ref';
import { IPSAppView } from '../../app/view/ipsapp-view';
import { PSAjaxControlContainerImpl } from '../psajax-control-container-impl';
import { IPSDEDRCtrl } from './ipsdedrctrl';
import { IPSDEDRCtrlItem } from './ipsdedrctrl-item';
import { IPSLanguageRes } from '../../res/ipslanguage-res';
import { IPSSysImage } from '../../res/ipssys-image';

export class PSDEDRCtrlImpl
  extends PSAjaxControlContainerImpl
  implements IPSDEDRCtrl
{
  get codeName(): string {
    return this.M.codeName;
  }

  protected edititemcappslanguageres: IPSLanguageRes;
  getEditItemCapPSLanguageRes(): IPSLanguageRes | null {
    return (
      this.edititemcappslanguageres ||
      (this.edititemcappslanguageres = this.fillObjectModel(
        S._276,
        this.M.getEditItemCapPSLanguageRes,
        S._339,
      ) as IPSLanguageRes)
    );
  }

  get editItemCaption(): string {
    return this.M.editItemCaption;
  }

  protected edititempssysimage: IPSSysImage;
  getEditItemPSSysImage(): IPSSysImage | null {
    return (
      this.edititempssysimage ||
      (this.edititempssysimage = this.fillObjectModel(
        S._27b,
        this.M.getEditItemPSSysImage,
        S._33a,
      ) as IPSSysImage)
    );
  }

  protected formpsappview: IPSAppView;
  getFormPSAppView(): IPSAppView | null {
    return (
      this.formpsappview ||
      (this.formpsappview = this.fillObjectModel(
        S._1e,
        this.M.getFormPSAppView,
        S._33b,
      ) as IPSAppView)
    );
  }

  protected psappcounterref: IPSAppCounterRef;
  getPSAppCounterRef(): IPSAppCounterRef | null {
    return (
      this.psappcounterref ||
      (this.psappcounterref = this.fillObjectModel(
        S._9d,
        this.M.getPSAppCounterRef,
        S._2a9,
      ) as IPSAppCounterRef)
    );
  }

  protected psdedrctrlitems: IPSDEDRCtrlItem[];
  getPSDEDRCtrlItems(): IPSDEDRCtrlItem[] | null {
    return (
      this.psdedrctrlitems ||
      (this.psdedrctrlitems = this.fillChildListModel(
        this.M.getPSDEDRCtrlItems,
        S._a0,
      ) as IPSDEDRCtrlItem[])
    );
  }

  findPSDEDRCtrlItem(objKey: any): IPSDEDRCtrlItem | null {
    return this.getPSModel5(
      S._a0,
      this.getPSDEDRCtrlItems(),
      objKey,
    ) as IPSDEDRCtrlItem;
  }

  get uniqueTag(): string {
    return this.M.uniqueTag;
  }

  get hideEditItem(): boolean {
    return this.M.hideEditItem != null ? this.M.hideEditItem : false;
  }
  get cls(): string {
    return 'PSDEDRCtrlImpl';
  }
  instanceof(cls: string): boolean {
    if (cls == S._21c || cls == S._21d) return true;
    return super.instanceof(cls);
  }
}
